<div class="grid_12">
    <div class="box round first fullpage">
        <h2>Danh sách liên hệ</h2>
        <div class="block" style="position: relative;">
            <div class="message warning loading">
                <p>Loading...</p>
            </div>
            <form class="form-search" onsubmit="return false">
                <dl class="zend_form">
                    <dt class="search-field"><label>Tìm kiếm: </label></dt>
                    <dd class="search-field"><input type="text" name="keyword" class="searchkey" /></dd>
                    <dt class="search-field"><label></label></dt>
                    <dd class="search-field"><button class="btn-mini btn-black btn-check"><span></span></button></dd>
                </dl>
            </form>
            <div class="dataTables_wrapper">
                <!-- Vị tri load datat-->
            </div>           
        </div>
    </div>
</div>

<script>
$(function(){
    //Khởi tạo dữ liệu ban đầu
    var link = "<?=$this->url(array("module"=>"admin","controller"=>"contact","action"=>"list"), null, true)?>";
    $(".loading").show();
    $.get(link,null,function(rdata){
        $(".dataTables_wrapper").html(rdata);
        $(".loading").fadeOut(1000);
    })
    
    // Tìm kiếm
    $(".search-field .btn-check").click(function(){
        var value = $(".searchkey").val();           
        data = {"filter_field":"fullname","filter_value":value};
        $(".loading").show();
        $.get(link,data,function(rdata){
            $(".dataTables_wrapper").html(rdata);
            $(".loading").fadeOut(1000);
        })
    })
   
})
</script>